package com.project.dao.implement;

import org.apache.ibatis.session.SqlSession;
import com.project.dao.AccountDataStatisticMapper;
import com.project.utils.SessionFactoryGen;
import java.util.List;
import java.util.Map;

public class AccountDataStatisticalImpl implements AccountDataStatisticMapper{
	@Override
	public long SelectInFundCount(Map param)
	{
		long result= 0;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (long)mapper.SelectInFundCount(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public float SelectInFundMoney(Map param)
	{
		float result= 0;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (float)mapper.SelectInFundMoney(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public long SelectOutFundCount(Map param)
	{
		long result= 0;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (long)mapper.SelectOutFundCount(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public float SelectOutFundMoney(Map param)
	{
		float result= 0;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (float)mapper.SelectOutFundMoney(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public List<String> SelectInAccountNumCount(Map param)
	{
		List<String>  result= null;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (List<String>)mapper.SelectInAccountNumCount(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public List<String> SelectOutAccountNumCount(Map param)
	{
		List<String>  result= null;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (List<String>)mapper.SelectOutAccountNumCount(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
	
	@Override
	public long SelectAccountCount(Map param)
	{
		long result= 0;
		SqlSession sqlSession = SessionFactoryGen.getSessionFactory().openSession();  
		
		try
		  {
			AccountDataStatisticMapper mapper =  sqlSession.getMapper(AccountDataStatisticMapper.class);
			  result = (long)mapper.SelectAccountCount(param);
			 // sqlSession.commit();
		  }
		  catch(Exception e)
		  {
			  e.printStackTrace();
		  }
		  finally
		  {
			  sqlSession.close();
		  }
		return result;
	}
}
